//
// Created on 6/1/25.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#include "vertex.h"
#include <hilog/log.h>
#include "../common/common.h"
VertexProp::VertexProp(){
    
}
VertexProp::~VertexProp(){}
void VertexProp::AddProperty(Property name, std::shared_ptr<PropertyTypeDef> prop) {
    auto iter = m_Properties.find(name);
    if (iter == m_Properties.end()) {
        // cout << "Map not find name" << endl;
        m_Properties[name] = prop;
    } else {
        OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN,"Vertex","Map not find name");
        return;
    }
}

std::shared_ptr<PropertyTypeDef> VertexProp::GetProperty(Property name) {
    auto iter = m_Properties.find(name);
    if (iter != m_Properties.end()) {
        // cout << "Map not find name" << endl;
        return m_Properties[name];
    } else {
        OH_LOG_Print(LOG_APP, LOG_INFO, LOG_PRINT_DOMAIN,"Vertex","Map not find name");
        return nullptr;
    }
}

std::map<Property, std::shared_ptr<PropertyTypeDef>> VertexProp::GetProperties() { return m_Properties; }